import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询字典数据列表
export function listDictItem(query) {
  return request({
    url: `/sys/dict/item/list`,
    method: HttpMethod.GET,
    params: query
  })
}

// 查询字典数据详细
export function getDictItem(dictItemId) {
  return request({
    url: '/sys/dict/item/' + dictItemId,
    method: HttpMethod.GET
  })
}

// 根据字典编码查询字典数据信息
export function getDictItems(dictCode) {
  return request({
    url: '/sys/dict/item/code/' + dictCode,
    method: HttpMethod.GET
  })
}

// 新增字典数据
export function addDictItem(data) {
  return request({
    url: '/sys/dict/item',
    method: HttpMethod.POST,
    data: data
  })
}

// 修改字典数据
export function updateDictItem(data) {
  return request({
    url: '/sys/dict/item',
    method: HttpMethod.PUT,
    data: data
  })
}

// 删除字典数据
export function delDictItem(dictItemIds) {
  return request({
    url: '/sys/dict/item/' + dictItemIds,
    method: HttpMethod.DELETE
  })
}
